/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Deal.Login_Customer;

import Data.DAO.ICustomerStore;
import data.pojo.Customer;
import java.util.List;

/**
 *
 * @author 伯乐
 */
public class General_LoginLogic {
    private ICustomerStore customerStore = new ICustomerStore();
    /*
    protected boolean userExist(String id, String code) {
        List<Customer> str = customerStore.searchObjectsByAttr("id", id);
        if(!str.isEmpty()){
            if(str.get(0).getPassword().equals(code)){
                return true;
            }
        }
        return false;
    }*/
    protected String getUserID(String name, String code){
        List<Customer> str = customerStore.searchObjectsByAttr("name", name);
        if(!str.isEmpty()){
            if(str.get(0).getPassword().equals(code)){
                return str.get(0).getId();
            }
        }
        return null;
    }
}
